﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml.Linq;
using BusinessObjects.BO_GetObjects;
using DigiLib;

public partial class controls_admin_UserAccessLog : Admin_Controls_Base {
    protected void Page_Load(object sender, EventArgs e) {
        base.removeHGC(divMessage);
        if (!IsPostBack)
            loadSyslog();
    }
    private void loadSyslog() {
        try {
            base.Page_size = 50;
            base.bindRepeater(rptSyslog, BO_cms_user_access_log.SelectAdmin(Keyword, base.Cur_page(pagerContainer), base.Page_size, 1), divMessage, pagerContainer);
        } catch (Exception ex) {
            divMessage.InnerHtml = MessageBox.Error("Lỗi", "Phát hiện lỗi trong quá trình xử lý: " + ex.Message);
        }

    }
    protected void btnClear_Click(object sender, EventArgs e) {
        BO_cms_user_access_log.Delete();
        loadSyslog();
        divMessage.InnerHtml = MessageBox.Success("Thông Báo", "Thực hiện thành công.");
    }
    protected void btnSearch_Click(object sender, EventArgs e) {
        string keyword = txtKeyword.Text.Trim();
        if (!string.IsNullOrEmpty(keyword) && !keyword.Equals("Hãy nhập từ khóa !")) {
            Response.Redirect(base.removeRequest(new string[] { "keyword", pagerContainer.ClientID }) + "&keyword=" + keyword);
        }
    }
}
